Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-6668: [Rust] [DataFusion] Implement CAST expression #5477

Closed
wants to merge 2 commits into from

Conversation

andygrove
Copy link
Member

No description provided.

@andygrove andygrove changed the title ARROW-6668: [Rust] [DataFusion[ Implement CAST expression ARROW-6668: [Rust] [DataFusion] Implement CAST expression Sep 23, 2019
@andygrove andygrove self-assigned this Sep 23, 2019
Copy link
Contributor

@paddyhoran paddyhoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @andygrove

let result = result
.as_any()
.downcast_ref::<UInt32Array>()
.expect("failed to downcast to UInt32Array");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about how the API is designed to work here. Why don't you handle the downcast in evaluate based on data_type()? Is it just that you don't want the user to always incur the cost of the match on data_type().


impl PhysicalExpr for CastExpr {
fn name(&self) -> String {
"CAST".to_string()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: there is inconsistency in upper vs lower case for name. The literal one was lower case, this one and SUM were upper case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants